package com.qiyi.player.core.model.remote
{
   import com.qiyi.player.base.rpc.impl.BaseRemoteObject;
   import com.qiyi.player.core.player.coreplayer.ICorePlayer;
   import flash.net.URLRequest;
   import com.qiyi.player.core.Config;
   import flash.events.Event;
   import com.qiyi.player.base.pub.EnumItem;
   import com.qiyi.player.base.rpc.RemoteObjectStatusEnum;
   import com.qiyi.player.core.model.utils.ErrorCodeUtils;
   
   public class MovieVerifyRemote extends BaseRemoteObject
   {
      
      public function MovieVerifyRemote(param1:ICorePlayer) {
         super(0,"MovieVerifyRemote");
         _timeout = 5000;
         _retryMaxCount = 2;
         this._holder = param1;
         this._holder.runtimeData.authenticationError = false;
      }
      
      private var _limited:Boolean = false;
      
      private var _holder:ICorePlayer;
      
      override protected function getRequest() : URLRequest {
         return new URLRequest(Config.CHECK_LIMIT_URL + this._holder.runtimeData.vid + "/");
      }
      
      override protected function onComplete(param1:Event) : void {
         this._limited = Boolean(_loader.data as String == "1");
         super.onComplete(param1);
      }
      
      override protected function setStatus(param1:EnumItem) : void {
         var _loc2_:* = 0;
         if(param1 == RemoteObjectStatusEnum.Timeout || param1 == RemoteObjectStatusEnum.ConnectError || param1 == RemoteObjectStatusEnum.DataError || param1 == RemoteObjectStatusEnum.AuthenticationError || param1 == RemoteObjectStatusEnum.SecurityError || param1 == RemoteObjectStatusEnum.UnknownError)
         {
            _loc2_ = ErrorCodeUtils.getErrorCodeByRemoteObject(this,param1);
            this._holder.pingBack.sendError(_loc2_);
            this._holder.runtimeData.errorCode = _loc2_;
         }
         super.setStatus(param1);
      }
      
      public function getIsLimited() : Boolean {
         return this._limited;
      }
   }
}
